<!DOCTYPE html>
<html>
    <head>
        <!-- 页面meta -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>传智健康</title>
        <meta name="description" content="传智健康">
        <meta name="keywords" content="传智健康">
        <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
        <!-- 引入样式 -->
        <link rel="stylesheet" href="../plugins/elementui/index.css">
        <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
        <link rel="stylesheet" href="../css/style.css">
        <!-- 引入组件库 -->

        <style type="text/css">
            body, html{width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
            #l-map{height:400px;width:98%;margin:0 auto;}
            #r-result{width:100%; font-size:14px;line-height:20px;}
        </style>
        <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=j385oopt9piMnWcoCmUTzCiZGTmPyDbC"></script>
        <style>
            .datatable {
                position: relative;
                box-sizing: border-box;
                -webkit-box-flex: 1;
                width: 100%;
                max-width: 100%;
                font-size: 14px;
                color: rgb(96, 98, 102);
                overflow: hidden;
                flex: 110%;
            }
            .datatable td, .datatable th {
                padding: 12px 0;
                min-width: 0;
                -webkit-box-sizing: border-box;
                box-sizing: border-box;
                text-overflow: ellipsis;
                vertical-align: middle;
                position: relative;
                text-align: left;
            }
        </style>
    </head>
    <body class="hold-transition">
        <div id="app">
            <div class="content-header">
                <h1>预约管理<small>检查组管理</small></h1>
                <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
                    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                    <el-breadcrumb-item>预约管理</el-breadcrumb-item>
                    <el-breadcrumb-item>检查组管理</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="app-container">
                <div class="box">
                    <div class="filter-container">
                        <el-button type="primary" @click="tomap()" class="butT">分布图</el-button>
                        <el-button href="detail.html"  @click="todetail()" class="dalfBut">详情页面</el-button>
                    </div>

                </div>

            </div>
        </div>
        <div id="l-map" ></div>
    </body>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script src="../js/axios-0.18.0.js"></script>

    <script type="text/javascript">
        // 百度地图API功能
        var map = new BMap.Map("l-map");
        map.centerAndZoom(new BMap.Point(118.773209,32.054829), 13);
        map.enableScrollWheelZoom(true);
        var index = 0;
        var myGeo = new BMap.Geocoder();
        function bdGEO(){
            if (index < adds.length) {
                var add = adds[index];
                geocodeSearch(add);
                index++;
            }
        }
        function addMarker(point,label){
            var marker = new BMap.Marker(point);
            map.addOverlay(marker);
            marker.setLabel(label);
        }
        function geocodeSearch(add){
            if(index < adds.length){
                setTimeout(window.bdGEO,80);
            }
            myGeo.getPoint(add, function(point){
                if (point) {
                    var address = new BMap.Point(point.lng, point.lat);
                    addMarker(address,new BMap.Label(index+":"+add,{offset:new BMap.Size(20,-10)}));
                }
            }, "南京市");
        }
        var adds = [ ];
        function findadress() {
            axios.post("/address/findadressname.do").then((res) => {
                //解析Controller相应的数据
                if (res.data.flag) {
                    adds = res.data.data;
                    bdGEO();
                }
            });

        }
        var vue = new Vue({
            el: '#app',
            data:{

            },
            created(){
                findadress();

            },
            methods: {
                tomap() {
                    window.location.href="map.html";

                },
                todetail(){
                    window.location.href="detail.html";
                },
                }

        });

    </script>







</html>
